home *** CD-ROM | disk | FTP | other *** search
- ready = false;
- this.onEnterFrame = function()
- {
- onFall();
- this._x -= _hitomi.speed;
- if(this.ready)
- {
- pushfactor = 10;
- if(_hitomi.hitTest(this))
- {
- damage = random(30) + 12;
- _hitomi.recieveHit(this);
- }
- var _loc3_ = 0;
- while(_loc3_ < _root.pics_list.length)
- {
- damage = random(16) + 5;
- var _loc5_ = _root.pics_list[_loc3_];
- var _loc4_ = _loc5_.obj;
- if(_loc4_.hitTest(this))
- {
- _loc4_.bombHit(damage,pushfactor);
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- };
- init = function()
- {
- gravity = 4;
- time = getTimer();
- time /= 100;
- rot = random(21) - 10;
- _rotation = 0;
- floor = _parent.floor;
- bounce = 0.22;
- speedx = random(12) - 3;
- speedystart = 0;
- _init = true;
- };
- this.onFall = function()
- {
- if(!_init)
- {
- init();
- }
- timenow = getTimer();
- timenow /= 100;
- speedy = gravity * (timenow - time) + speedystart;
- this._x += speedx / 5;
- this._y += speedy / 5;
- if(this._y > floor)
- {
- this._y = floor;
- speedy *= - bounce;
- time = getTimer();
- time /= 100;
- rot *= -0.5;
- speedystart = speedy;
- }
- if(speedy < 1 && _Y + 2 > floor)
- {
- speedx = 0;
- this.onRotate = function()
- {
- if(_rotation % 360 > 180)
- {
- }
- if(Math.abs(_rotation) < 2)
- {
- delete this.onRotate;
- }
- };
- }
- onRotate();
- };
- if(!_init)
- {
- init();
- }
- playSound = function(ids)
- {
- _root.sounds.playSound(ids);
- };
-